Write a custom CUDA kernel to optimize `MishGLU`.

The operation defines a Gated Linear Unit with Mish activation.
Given an input tensor `x` of shape `(..., 2*C)`, it splits the last dimension into `a` and `b` (each size `C`).
Formula: `output = a * Mish(b)`.
Where `Mish(x) = x * tanh(softplus(x)) = x * tanh(ln(1 + exp(x)))`.

Problem Analysis:
1. Memory Bandwidth: The PyTorch implementation `x.chunk(2)`, `F.mish(b)`, `a * b` creates multiple read/write passes. Specifically, calculating Mish involves chained element-wise operations creating intermediate tensors.
2. Numerical Stability: Direct computation of `exp(x)` in Softplus can overflow for large positive inputs. A stable implementation using a threshold is required.

Optimization Strategy: Fused Element-wise Kernel with Vectorized Splits

1. Fused Split-Act-Mul: The kernel operates on the input tensor `(N, 2C)` and produces `(N, C)`. For each output element index `i` (within a row), the kernel reads `a = input[row_offset + i]` and `b = input[row_offset + C + i]` simultaneously.

2. Vectorized Loads (float4): Assign each thread to process 4 output elements.
   - Load `float4` from part A.
   - Load `float4` from part B (offset by `C`).
   - This effectively processes 8 input floats per thread iteration, maximizing throughput.

3. In-Register Stable Mish:
   - Implement `Softplus` with stability check: `val > 20 ? val : log1p(exp(val))`.
   - Compute `Mish`: `val * tanh(softplus_val)`.
   - Compute `MishGLU`: `a * mish_b`.

4. One Pass: The entire split, activation, and gating happens in registers, writing only the final result to global memory.
  
Here's an example to show you the syntax of inline embedding custom CUDA operators in torch: The example given architecture is:   
  
```python
import torch
import torch.nn as nn
import torch.nn.functional as F

BATCH_SIZE = 4096
HIDDEN_DIM = 8192 
SHAPE = (BATCH_SIZE, HIDDEN_DIM * 2)

class MishGLU(nn.Module):
    """
    Mish Gated Linear Unit.
    Input: (*, 2C)
    Output: (*, C)
    Formula: a * Mish(b)
    """
    def __init__(self):
        super(MishGLU, self).__init__()

    def forward(self, x: torch.Tensor) -> torch.Tensor:
        a, b = x.chunk(2, dim=-1)
        # Mish Activation
        # Mish(x) = x * tanh(softplus(x))
        b_act = F.mish(b)
        
        # 3. Gating
        return a * b_act

class Model(nn.Module):
    def __init__(self):
        super(Model, self).__init__()
        self.mish_glu = MishGLU()
    
    def forward(self, x):
        return self.mish_glu(x)

def get_inputs():
    input_tensor = torch.randn(SHAPE, dtype=torch.float32)
    return [input_tensor.contiguous()]

def get_init_inputs():
    return []